package su2010.puz.impl;

import java.awt.Image;
import java.awt.image.BufferedImage;

import com.matthewtavares.jipt.processing.ImageOperator;
import com.matthewtavares.jipt.processing.SobelEdgeDetector;

import su2010.puz.Filter;
import su2010.puz.ImageHelper;

/**
 * Gradient image filter (Sobel operator). Finds vertical and horizontal
 * gradient of image and merges them.
 * @author Mateja
 *
 */
public class SobelEdgeFilter implements Filter {

	@Override
	public BufferedImage apply(BufferedImage img) {
		ImageOperator sobel =  new SobelEdgeDetector();
		Image image = sobel.transform(img);
		return ImageHelper.getBufferedImage(image);
	}

}
